package com.test.thread;

import java.io.IOException;
import java.io.InputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public class Run {
	public static void main(String[] args) {
		writeData wd = new writeData();
		ReadData rd = new ReadData();
		PipedInputStream pin = new PipedInputStream();
		PipedOutputStream pout = new PipedOutputStream();
		try {
			pout.connect(pin);
			ThreadRead tr = new ThreadRead(rd, pin);
			tr.start();
			
			Thread.sleep(2000);
			
			
			ThreadWrite tw = new ThreadWrite(wd, pout);
			tw.start();
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
